//
//  LKSportTrack.h
//  SportDemo
//
//  Created by Lukj on 2017/4/22.
//  Copyright © 2017年 lukj. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <MAMapKit/MAMapKit.h>
#import "LKSportPolyline.h"

typedef enum : NSUInteger {
    SportTrackTypeRuning, //    跑步
    SportTrackTypebicycling,//  骑行
    SportTrackTypewalking,//    步行
} SportTrackType; //    运动类型


typedef enum : NSUInteger {
    SportStateContinue, //  继续
    SportStatePause,//    暂停
    SportStateEnd,//    结束
} SportState;// 运动的状态

typedef enum : NSUInteger {
    SportMapGPSStateDisconnect,//   断开
    SportMapGPSStateBad,//  差
    SportMapGPSStateNormal,//   正常
    SportMapGPSStateGood,// 好
} SportMapGPSState;//   GPS状态

//运动轨迹模型  记录运动轨迹相关的数据(轨迹折线,轨迹颜色,轨迹距离..)
@interface LKSportTrack : NSObject
//  起点大头针模型
@property (nonatomic, strong, readonly) MAPointAnnotation *pointAnnotation;

//  运动类型
@property (nonatomic, assign, readonly) SportTrackType sportTrackType;
//  大头针视图名称
@property (nonatomic, copy, readonly) NSString *pointAnnotationImageName;
//  运动状态
@property (nonatomic, assign) SportState sportState;
//  总距离 km
@property (nonatomic, assign, readonly) CGFloat totalDistace;
//  总时长 s
@property (nonatomic, assign, readonly) CGFloat totalTime;
//  最大速度 km/h
@property (nonatomic, assign, readonly) CGFloat maxSpeed;
//  平均速度 km/h
@property (nonatomic, assign, readonly) CGFloat avgSpeed;
//  总时间的字符串
@property (nonatomic, copy, readonly) NSString *totalTimeStr;

/**
 设置大头针视图类型

 @param sportTrackType 大头针类型
 @param sportState 运动的状态
 @return 轨迹模型
 */
- (instancetype)initWithSportTrackType:(SportTrackType)sportTrackType andSportState:(SportState)sportState;

/**
 添加折线
 
 @param dest 折线终点(每一段的终点是上一段的起点)
 @return 折线模型
 */
- (LKSportPolyline *)appendPolylineDest:(CLLocation *)dest;

//- (MAPointAnnotation *)appendSourcePointAnnotation:(CLLocationCoordinate2D)source;
@end
